home *** CD-ROM | disk | FTP | other *** search
/ Rat Attack (UK) (Digital Press Kit - Summer '99) / Rat Attack (UK) (Digital Press Kit - Summer '99).bin / RAT01.DIR / 00230_Script_Go to Marker < prev    next >
Text File  |  1999-04-26  |  2KB  |  67 lines

  1. -- Marker  Go to/Play Marker
  2.  
  3. -- nav
  4. -- behavior library version 1.1
  5. -- drag to a sprite 
  6.  
  7. -- Allows author to assign which event will cause the 'go to label' action
  8. -- drag to sprite
  9. -- also functions through lingo by handling message 'initGotoMarker', 
  10. -- for example if this behavior was assigned to sprite 5, use
  11. -- sendsprite 5, #initGotoMarker
  12.  
  13. property  whichEvent, whichLabel,playmode
  14.  
  15. on initGotoMarker me
  16.   init me
  17. end
  18.  
  19. on mouseUp me
  20.   if whichEvent = #mouseup    then init me
  21. end
  22.  
  23. on mouseEnter me
  24.   if whichEvent = #mouseenter    then init me
  25. end
  26.  
  27.  
  28.  
  29. on exitFrame me
  30.   if whichEvent = #exitframe  then init me
  31. end
  32.  
  33. on init me
  34.   if the playmode of me = #"Go to" then
  35.     case ( whichLabel ) of:
  36.       #Previous: go to marker( -1 )
  37.       #Loop:     go to marker(  0 )
  38.       #Next:     go to marker(  1 )
  39.       otherwise:
  40.         go to whichLabel    
  41.     end case
  42.   else
  43.     case ( whichLabel ) of:
  44.       #Previous: play marker( -1 )
  45.       #Loop:     play marker(  0 )
  46.       #Next:     play marker(  1 )
  47.       otherwise:
  48.         play whichLabel    
  49.     end case
  50.   end if
  51.   
  52. end
  53.  
  54.  
  55.  
  56.  
  57. ---
  58.  
  59. on getPropertyDescriptionList
  60.   set p_list = [     #WhichLabel: [ #comment:   "Destination Marker:",                     #format:   #marker,                    #default:  "#Loop" ],     #WhichEvent: [ #comment:   "Initializing Event:",                     #format:   #symbol,                      #range: [ #MouseUp, #MouseEnter, #ExitFrame, #InitGotoMarker],                    #default:   #MouseUp ],       #playMode: [ #comment:   "Play Mode:",                     #format:   #symbol,                      #range: [ #"Go to", #"Play and Return" ],                    #default:   #"Go to" ]   ]
  61.   return p_list
  62. end
  63.  
  64. on getBehaviorDescription
  65.   return "Moves the Playback Head to a designated marker when the specified event occurs.  Drag to a sprite or a frame in the script channel." && RETURN & "PARAMETERS:" && RETURN & "ò Destination Marker - Choose from a list of all marker names in the current movie or choose Previous, Loop (Current), or Next."  && RETURN & "ò Initializing Event - Specify the event that triggers the behavior." & RETURN & "ò Play Mode - Choose Play and Return to make the Playback Head return to the current location when the Play Done behavior is encountered. Choose Go To to make the Playback Head continue from the specified frame until explicitly sent to a new location." 
  66. end
  67.